/**
  ******************************************************************************
  * @file    systick.h
  * @author  chengbb
  * @version V1.0
  * @date    2017-03-02
  * @brief   systick配置头文件
  ******************************************************************************
  * @attention
  *
  * THE PRESENT FIRMWARE WHICH IS FOR GUIDANCE ONLY AIMS AT PROVIDING CUSTOMERS
  * WITH CODING INFORMATION REGARDING THEIR PRODUCTS IN ORDER FOR THEM TO SAVE
  * TIME. AS A RESULT, STMICROELECTRONICS SHALL NOT BE HELD LIABLE FOR ANY
  * DIRECT, INDIRECT OR CONSEQUENTIAL DAMAGES WITH RESPECT TO ANY CLAIMS ARISING
  * FROM THE CONTENT OF SUCH FIRMWARE AND/OR THE USE MADE BY CUSTOMERS OF THE
  * CODING INFORMATION CONTAINED HEREIN IN CONNECTION WITH THEIR PRODUCTS.
  *
  * <h2><center>&copy; COPYRIGHT 2017 MindX</center></h2>
  ******************************************************************************
  */
/** @addtogroup BSP
* @{
*/
#ifndef __SYSTICK_H_
#define __SYSTICK_H_

#ifdef __cplusplus
extern "C" {
#endif

#include "stm32f10x.h"

/** 1秒嘀嗒数 */
#define SYSTICK_PER_SECOND      1000			//1S

/** 嘀嗒软件定时器结构*/
typedef struct SYSTIMER
{
    uint8_t     active;          /**< 是否激活 */     
    uint32_t    start;           /**< 开始时间 */ 
    uint32_t    interval;  	     /**< 到时时间 */ 
}softtimer_t;

//extern softtimer softtime;

void SysTick_Init(void);
uint32_t Get_Systick(void);

void Timer_Set(softtimer_t *t, uint32_t interval);
void Timer_Restart(softtimer_t *t);
void Timer_Stop(softtimer_t *t);
uint32_t Timer_Expired(softtimer_t *t);
void Timer_Delay(uint32_t tick);
	 

#endif 

/**
  * @}
  */
/*********************file end (c)CBB************************/
